package com.ckk.rabbitmq.config;


import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

/**
 * @author 陈昆昆
 * @version 1.0
 * @date 2020/6/20 14:19
 */
public class ConnectionConfig {
    public static Connection getconnection() throws IOException, TimeoutException {
        ConnectionFactory factory = new ConnectionFactory();
        factory.setHost("116.62.160.24");
        //端口
        factory.setPort(5672);
        factory.setUsername("guest");
        factory.setPassword("guest");
        factory.setVirtualHost("/");
        Connection connection = factory.newConnection();
        return connection;
    }
}
